package www.lagou.entity;

import java.util.Objects;

/**
 * employee 表对应的 JavaBean 类。
 */
public class Employee {
    private int id;
    private String name;
    private double age;
    private String sex;
    private double salary;
    private String empdate;
    private int did;

    private Dept dept;

    public Employee() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getAge() {
        return age;
    }

    public void setAge(double age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String getEmpdate() {
        return empdate;
    }

    public void setEmpdate(String empdate) {
        this.empdate = empdate;
    }

    public int getDid() {
        return did;
    }

    public void setDid(int did) {
        this.did = did;
    }

    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Employee employee = (Employee) o;
        return id == employee.id &&
                Double.compare(employee.age, age) == 0 &&
                Double.compare(employee.salary, salary) == 0 &&
                did == employee.did &&
                Objects.equals(name, employee.name) &&
                Objects.equals(sex, employee.sex) &&
                Objects.equals(empdate, employee.empdate) &&
                Objects.equals(dept, employee.dept);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age, sex, salary, empdate, did, dept);
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", salary=" + salary +
                ", empdate='" + empdate + '\'' +
                ", did=" + did +
                ", dept=" + dept +
                '}';
    }
}
